package com.example.mapp;

import com.example.entity.authority.SystemRoleTypeRelation;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by youkun on 2018/3/20.
 */
@Mapper
public interface SystemRoleTypeRelationMapp {

    @Insert("insert into System_Role_Type_Relation ( " +
            "role_Id,role_Type_Id"+
            ") values (" +
            "#{roleId},#{roleTypeId}"+
            ")")
    @SelectKey(statement="select last_insert_id()",keyProperty = "id",keyColumn = "id",before = false,resultType = Long.class)
    int insert(SystemRoleTypeRelation systemRoleTypeRelation) throws Exception;

    @Delete("delete from System_Role_Type_Relation where role_Type_Id = #{roleTypeId}")
    int delete(Long roleTypeId)throws Exception;

    @Select("select * from System_Role_Type_Relation where role_Type_Id = #{roleTypeId}")
    List<SystemRoleTypeRelation> queryByRoleTypeId(Long roleTypeId) throws Exception;
}
